import allure
import pytest
from common.logger import Logger
def assert_api(actual_data,expect_data):
    Logger.info("*************** {}开始执行用例 ***************".format(expect_data['info']))
    try:
        assert actual_data['code'] == expect_data['except_code']
        assert actual_data['message'] == expect_data['except_msg']
    except AssertionError as e:
        Logger.error('=====>{}用例执行未通过'.format(expect_data['info']))
        # 将异常抛出
        raise e
    Logger.info("*************** {}--用例通过 ***************".format(expect_data['info']))